#include <cstdio>
int hash[26] = {0};
int main()
{
    char c;
    while ((c = getchar()) != '\n')
    {
        if (c >= 'A' && c <= 'Z')
        {
            c += 32; //大写转换成小写
            ++hash[c - 'a'];
        }
        else if (c >= 'a' && c <= 'z')
        {
            ++hash[c - 'a'];
        }
    }
    int max = 0;
    for (int i = 0; i < 26; ++i)
    {
        if (hash[i] > max)
        {
            c = i + 'a';
            max = hash[i];
        }
    }
    printf("%c %d\n", c, max);
    return 0;
}